package com.itheima.edu.info.manager.day15;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.ArrayList;

public class UdpSTest {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket(20000);
        //ArrayList list=new ArrayList();
        byte [] b=new byte[1024];
        DatagramPacket dp=new DatagramPacket(b,b.length);
        ds.receive(dp);
        System.out.println(new String(dp.getData(),0,dp.getLength()));

    }
}
